package com.xc.web.controller;

import com.xc.domain.AjaxResult;
import com.xc.domain.pojo.SysDept;
import com.xc.service.SysDeptService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "部门的相关接口")
@RestController
@RequestMapping("/dept")
public class DeptController {

    @Autowired
    private SysDeptService sysDeptService;

    @PostMapping("/tree")
    public AjaxResult TreeDept(){
        List<SysDept> sysDepts = sysDeptService.ChildTreeDept();
        if (sysDepts!=null){
            return AjaxResult.success("操作成功");
        }
        return AjaxResult.error("操作失败");
    }
}
